package com.gylang.common.utils;

import lombok.extern.slf4j.Slf4j;

import java.util.function.Supplier;

/**
 * @author gylang
 * data 2021/6/1
 */
@Slf4j
public class InvokeUtil {


	public static <T> T ignoreException(Supplier<T> invoker) {
		try {
			return invoker.get();
		} catch (Exception e) {
			log.error("[错误忽略, 执行异常] {}", e.getMessage());
		}
		return null;
	}
}
